package com.shawn.function;

import java.util.Arrays;
import java.util.List;
import java.util.function.Predicate;

public class PredicateDemo2 {

	public static void main(String[] args) {
		List<String> list = Arrays.asList("java","sql","spring","python");
		Predicate<String> predicate = s -> {
			return s.equals("spring");
		};

		for (int i = 0; i < list.size(); i++) {
			if(predicate.test(list.get(i))){
				System.out.println(list.get(i));
			}
		}
	}

}
